<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

// Create a shortcut for params.
$params = &$this->item->params;
$images = json_decode($this->item->images);
$canEdit	= $this->item->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::core();

?>

<div class="customer">
	
				<div style="float:left; padding-right:15px">
				
				<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>" >
			
			
			
			<?php
			//code lay hinh
				$arr2 = preg_split('/<(IMG|img) /', $this->item->introtext);
	
	
				//if(sizeof($arr2) <= 1) return '';
			    
			    
				$arr3 = preg_split('/src=\"/', $arr2[1]);
			    
			    
				//if(sizeof($arr3) <= 1) return '';
			    
				$arr4 = preg_split('/\"/', $arr3[1]);
			    
			    
			    
				if(preg_match('/http:/', $arr4[0]))
				{
				    $result = $arr4[0];
				}
				else if(preg_match('/^\//', $arr4[0])){
				    $result = $u2 . substr($arr4[0],1);
				}
				else
				{
				    for($ei = 3; $ei < sizeof($u1) - 1; $ei++)
				    {
					$u2 .= $u1[$ei] . "/";
				    }
				    $result = $u2 . $arr4[0];
				}
			
			?>
			<?php if($result != ""){ ?>

			<img src="<?php echo $result; ?>" alt="" title="<?php echo $this->item->title; ?>"  class="img_service" />

			<?php } ?>
		</a></div>        
					


			
				<h3>
					<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>"><?php echo $this->item->title; ?></a></h3>
					<p class="caps">
					
						<?php 
				
										$arr = explode(" ", strip_tags($this->item->introtext));
										if(count($arr) >= 40)
										{
											$this->item->sintrotext = "";
											for($i=0; $i < 40; $i++)
											{
												$this->item->sintrotext .= $arr[$i]." ";
											}
											$this->item->sintrotext .= "...";
										}
										else $this->item->sintrotext = strip_tags($this->item->introtext);
										$this->item->sintrotext = str_replace("\"", "", $this->item->sintrotext);
										
										echo $this->item->sintrotext;
						?>
					
					<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>" class="more-link"><?php echo JTEXT::_("COM_CONTENT_READ_MORE_TITLE"); ?></a></p>
	
</div><!--end customer-->
